package com.thd.springboottest.security.utils;

/**
 * com.thd.springboottest.security.utils.R
 *
 * @author: wanglei62
 * @DATE: 2022/6/28 11:10
 **/
public class R<T> {
    private Integer code ;


    private String status;

    private T result;

    public R(Integer code,  String status,T result) {
        this.code = code;
        this.status = status;
        this.result = result;
    }

    public static  R success(Object msg){
        R r = new R(200,"OK",msg);
        return r;
    }

    public static R failure(Object msg){
        R r = new R(500,"ERROR",msg);
        return r;
    }

    public T getResult() {
        return result;
    }

    public void setResult(T result) {
        this.result = result;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }


}
